<!--
 * @Author: dazy dazy916@126.com
 * @Date: 2025-09-18 11:37:49
 * @LastEditors: dazy dazy916@126.com
 * @LastEditTime: 2025-09-22 13:56:34
 * @FilePath: \H5\src\pages\login.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup>
import { reactive, ref, onMounted, getCurrentInstance } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useChatStore } from '@/store'
const { proxy: { $http } } = getCurrentInstance()
const store = useChatStore()

const route = useRoute()
const router = useRouter()
const dataVal = reactive({})
const show = ref(true)
const checked = ref('1')
const loginType = ref(null)
const selectType = (val) => {
  store.loginType = checked.value
  sessionStorage.setItem('loginType', checked.value)
  loginType.value = sessionStorage.getItem('loginType', checked.value)
  router.push(checked.value)
}
onMounted(() => { })
</script>
<template>
  <van-dialog v-model:show="show" title="请选择登录类型"  @confirm="selectType" v-if="!loginType">
    <van-radio-group v-model="checked">
      <van-cell-group inset>
        <van-cell title="教师端" clickable>
          <template #right-icon>
            <van-radio name="teachIndex" />
          </template>
        </van-cell>
        <van-cell title="学生端" clickable>
          <template #right-icon>
            <van-radio name="studentIndex" />
          </template>
        </van-cell>
      </van-cell-group>
    </van-radio-group>
  </van-dialog>

</template>
<style scoped lang='scss'></style>